package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Snrgqrjy type
*/
@SuppressWarnings("ALL")
public class Snrgqrjy {


        private static volatile Snrgqrjy instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Snrgqrjy getInstance() {
            if (instance == null) {
                synchronized (Snrgqrjy.class) {
                    if (instance == null) {
                        instance = new Snrgqrjy();
                    }
                }
            }
            return instance;
        }


        private Snrgqrjy() {

        }



    public  Boolean judgeDbvrecfthh(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeCrlnvncije(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeNrweqibrxd(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeOecjhqjbdx(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePxipsvigdb(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeQhpzbjijtj(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeAwzwezxtlt(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeTspkqhoejj(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeJtuqefjqyw(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeKvvxussprm(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeTlrgwcguhz(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeVewanwozkz(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  dbvrecfthh;
    private String  crlnvncije;
    private String  nrweqibrxd;
    private String  oecjhqjbdx;
    private String  pxipsvigdb;
    private String  qhpzbjijtj;
    private String  awzwezxtlt;
    private String  tspkqhoejj;
    private String  jtuqefjqyw;
    private String  kvvxussprm;
    private String  tlrgwcguhz;
    private String  vewanwozkz;


    public void setDbvrecfthh(String dbvrecfthh){
    this.dbvrecfthh = dbvrecfthh;
    }

    public String getDbvrecfthh(){
    return this.dbvrecfthh;
    }
    public void setCrlnvncije(String crlnvncije){
    this.crlnvncije = crlnvncije;
    }

    public String getCrlnvncije(){
    return this.crlnvncije;
    }
    public void setNrweqibrxd(String nrweqibrxd){
    this.nrweqibrxd = nrweqibrxd;
    }

    public String getNrweqibrxd(){
    return this.nrweqibrxd;
    }
    public void setOecjhqjbdx(String oecjhqjbdx){
    this.oecjhqjbdx = oecjhqjbdx;
    }

    public String getOecjhqjbdx(){
    return this.oecjhqjbdx;
    }
    public void setPxipsvigdb(String pxipsvigdb){
    this.pxipsvigdb = pxipsvigdb;
    }

    public String getPxipsvigdb(){
    return this.pxipsvigdb;
    }
    public void setQhpzbjijtj(String qhpzbjijtj){
    this.qhpzbjijtj = qhpzbjijtj;
    }

    public String getQhpzbjijtj(){
    return this.qhpzbjijtj;
    }
    public void setAwzwezxtlt(String awzwezxtlt){
    this.awzwezxtlt = awzwezxtlt;
    }

    public String getAwzwezxtlt(){
    return this.awzwezxtlt;
    }
    public void setTspkqhoejj(String tspkqhoejj){
    this.tspkqhoejj = tspkqhoejj;
    }

    public String getTspkqhoejj(){
    return this.tspkqhoejj;
    }
    public void setJtuqefjqyw(String jtuqefjqyw){
    this.jtuqefjqyw = jtuqefjqyw;
    }

    public String getJtuqefjqyw(){
    return this.jtuqefjqyw;
    }
    public void setKvvxussprm(String kvvxussprm){
    this.kvvxussprm = kvvxussprm;
    }

    public String getKvvxussprm(){
    return this.kvvxussprm;
    }
    public void setTlrgwcguhz(String tlrgwcguhz){
    this.tlrgwcguhz = tlrgwcguhz;
    }

    public String getTlrgwcguhz(){
    return this.tlrgwcguhz;
    }
    public void setVewanwozkz(String vewanwozkz){
    this.vewanwozkz = vewanwozkz;
    }

    public String getVewanwozkz(){
    return this.vewanwozkz;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}